package czc.hly.spring.formework.webmvc.servlet;

import czc.hly.spring.formework.context.GPApplicationContext;

import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by Administrator on 2018\10\31 0031.
 */
//Servlet 只是作为一个MVC的启动入口
public class DispatcherServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        this.doPost(req,resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("begin");
    }

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        GPApplicationContext context = new GPApplicationContext(config.getInitParameter("contextConfigLocation"));
    }
}
